﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Cloud.Model;
using Cloud.BLL;


public partial class Three_Managerment_Problem_two_Edit : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Session["users"] == null)
            {
                Response.Write("<script>alert('登录超时'); window.parent.location.href='/index.html'</script>");
            }
            if (Request.QueryString["type"].Equals("look"))
            {
                this.paiq.Visible = false;
                this.send_btn.Visible = false;
                this.ok_btn.Visible = false;
                this.Button1.Visible = false;
            }
            if (Request.QueryString["type"].Equals("banj"))
            {
                this.paiq.Visible = false;
                this.send_btn.Visible = false;
            }
            if (Request.QueryString["type"].Equals("daiban"))
            {
                this.ok_btn.Visible = false;
            }
            if (!IsPostBack)
            {
                int id = Convert.ToInt32(Request.QueryString["id"]);
                Problem activity = ProblemManager.FindById(id);
                if (activity != null)
                {
                    this.sjid.Value = activity.Appealid.ToString();
                    this.times.Value = activity.Regtime.ToString();
                    this.name.Value = activity.Appeal_name.ToString();
                    this.source.Value = SourcesManager.FindById(activity.Source_id).Name;
                    this.tel.Value = activity.Appeal_tel;
                    this.guis.Value = AscriptionManager.FindById(activity.Ascription_id).Name;
                    this.dalei.Value = Classification_Appeal1Manager.FindById(activity.Appeal_type_id).Name;
                    this.xiaolei.Value = Classification_Appeal2Manager.FindById(activity.Xialei).Name;
                    this.email.Value = activity.Appeal_email;
                    this.title.Value = activity.Title;
                    this.con.Value = activity.Context;
                }
            }
        }
        catch (Exception ex)
        {
            Response.Write("<script>alert('登录超时'); window.parent.location.href='/index.html'</script>");
            return;
        }
    }
    protected void send_btn_Click(object sender, EventArgs e)
    {
        if (Session["users"] == null)
        {
            Response.Write("<script>alert('登录超时'); window.parent.location.href='/index.html'</script>");
        }
        //int id = Convert.ToInt32(Request.QueryString["id"]);
        //Problem activity1 = ProblemManager.FindById(id);
        //activity1.Handle_type = 4;
        //ProblemManager.Update(activity1);
        Response.Write("<script>location.href='Bj.aspx?type=zhiban&id=" + Request.QueryString["id"] + "'</script>");
    }
    protected void paiq_Click(object sender, EventArgs e)
    {
        if (Session["users"] == null)
        {
            Response.Write("<script>alert('登录超时'); window.parent.location.href='/index.html'</script>");
        }
        Response.Write("<script>location.href='PaiQ.aspx?bm=one&id="+Request.QueryString["id"]+"'</script>");
    }
    protected void ok_btn_Click(object sender, EventArgs e)
    {
        if (Session["users"] == null)
        {
            Response.Write("<script>alert('登录超时'); window.parent.location.href='/index.html'</script>");
        }
        //int id = Convert.ToInt32(Request.QueryString["id"]);
        //Problem activity1 = ProblemManager.FindById(id);
        //activity1.Handle_type = 3;
        //ProblemManager.Update(activity1);
        Response.Write("<script>location.href='Bj.aspx?type=shenban&id=" + Request.QueryString["id"] + "'</script>");
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (Session["users"] == null)
        {
            Response.Write("<script>alert('登录超时'); window.parent.location.href='/index.html'</script>");
        }
        Response.Write("<script>location.href='Bj.aspx?type=boh&id=" + Request.QueryString["id"] + "'</script>");
    }
}